%% this is an example script that draws on different functions to conduct simulations using vensim

venFl='C:\Program Files (x86)\Vensim7\vensimdp';    % Vensim exe file to be called for simulations
cntlFl='CMDInputs.csv';                             % the control file input to be used
modFl='OSM_Master_0730.mdl';                        % The model to be used in this analysis

%directory to conduct the analysis
dirNm='C:\Users\hazhi\Dropbox (Personal)\Educational\Modeling and Analysis Tools\VensimMatlabScripter\';

% go to the directory
cd(dirNm)


cmdFl=[dirNm 'commandTest.cmd'];                    % Names the command file in directory
Controls=readControls(cntlFl);                      % Read controls from the csv
writeCMD(modFl,Controls,cmdFl);                     % Write the command file for vensim
outnum=callVensim(venFl,cmdFl);                     % Call the command file and execute using Vensim